

import Vue from 'vue';
import { _ } from 'vue-underscore';

const allAction = function (target, flag, property) {
	var output = [];

	_.each(target, function (item) {
		item.checked = flag;
		if (flag) {
			output.push(item[property]);
		}
	});

	if (!flag) {
		output = [];
	}
	return output;
};


Vue.prototype.$allChecked = allAction;
